package com.sn.system.common.freemarker.manager;

import javax.servlet.ServletContext;

import com.sn.system.common.freemarker.model.DatetimeMethod;

import org.apache.struts2.views.freemarker.FreemarkerManager;


import freemarker.template.Configuration;
import freemarker.template.TemplateException;

public class ExtendedFreemarkerManager extends FreemarkerManager {

    @Override
    protected Configuration createConfiguration(ServletContext servletContext) throws TemplateException {
        Configuration configuration = super.createConfiguration(servletContext);
        configuration.setSharedVariable("datetime", new DatetimeMethod()); // 加入时间日期处理
        return configuration;
    }
}
